import traceback
import sys
import time


def func(a, b):
    return a / b


if __name__ == '__main__':
    try:
        func(1, 0)
    except Exception as e:
        print('****', type(e), e, '****')
        time.sleep(1)

        print('****traceback.print_exc():****')
        time.sleep(1)
        traceback.print_exc()
        time.sleep(2)

        print('****traceback.format_exc():****')
        time.sleep(1)
        print(traceback.format_exc())
        time.sleep(2)

        print('****traceback.print_exception():****')
        time.sleep(1)
        traceback.print_exception(*sys.exc_info())
